import request from '@/utils/request'

// 查询商品列表列表
export function listGoods(query) {
  return request({
    url: '/good/commodity/goods/list',
    method: 'get',
    params: query
  })
}

// 查询商品列表列表
export function listGoods1(query1) {
  return request({
    url: '/good/commodity/goods/list1',
    method: 'get',
    params: query1
  })
}

// // 查询商品规格列表
// export function listProduct(goodsid) {
//   return request({
//     url: '/good/commodity/goods/product/' + goodsid,
//     method: 'get',
//   })
// }

// 查询商品规格列表
export function listProduct(query2) {
  return request({
    url: '/good/commodity/goods/product',
    method: 'get',
    params: query2
  })
}

// 查询商品规格详情
export function listProductXiangQ(query2) {
  return request({
    url: '/good/commodity/goods/productXiangQ',
    method: 'get',
    params: query2
  })
}

// 查询商品列表详细
export function getGoods(id) {
  return request({
    url: '/good/commodity/goods/' + id,
    method: 'get'
  })
}

// 新增商品列表
export function addGoods(data) {
  return request({
    url: '/good/commodity/goods',
    method: 'post',
    data: data
  })
}

// 修改商品列表
export function updateGoods(data) {
  return request({
    url: '/good/commodity/goods',
    method: 'put',
    data: data
  })
}

// 删除商品列表
export function delGoods(id) {
  return request({
    url: '/good/commodity/goods/' + id,
    method: 'delete'
  })
}

// 使用商品id查询商品
export function selGoods(id) {
  return request({
    url: `/good/commodity/goods/goods/${id}`,
    method: 'get'
  })
}
